<?php
require_once 'application/library/controller/gcLBasicAction.php';
require_once 'application/library/exception/gcExceptionDealer.php';
require_once 'application/modules/example/constant/example_constant_templatName.php';

/**
 * example_exampleUploadController
 * @author   Founder
 * @version   1.0
 * @exlcude   作成日:2010/08/11
 */
class example_exampleUploadController extends gcLBasicAction{
    /**
     * 初期表示
     * indexAction 
     * @throws gcException
     * @return
     */
    public function indexAction(){
        try{
            $this->setPageInfo();
            
            $this->gcView->render(example_constant_templatName::EXAMPLE_UPLOAD);
        }catch (Exception $e){
             gcExceptionDealer::setException($e);
        }
    }
    
    /**
     * updateAction
     * @return
     */
     public function uploadAction(){
            $arrUploadFileInfo  = $this->getUploadObjParam("upload_file");


            if ($arrUploadFileInfo["status"] == self::STATE_ZERO) {
                $strDirPath = "c:/";
                //mkdir($strDirPath);
                $arrFileUpResult = fileHelper::upload("upload_file", $strDirPath);
                $arrOutPut = array("BoolFlag" => 1);
            }
            jsonHelper::outPutJson($arrOutPut);
    }
    
    /**
     *
     * Enter description here ...
     */
    private function setPageInfo(){
        $this->gcView->title        = $this->getLabel("title");
        $this->gcView->upload        = $this->getLabel("upload");
    }
}